#include <stdio.h>
#include <math.h>

main()
{	 	   	    	
    long int sum, temp;
    int i, j, n;
    sum = 0;//1
    printf("please input how many terms you want to compute?:\n");
    scanf("%d", &n);//1
    if (n < 1 || n >= 10)//2
    {	 	   	    	
        printf("Overflow!\n");
    }
    else
    {	 	   	    	
        for (i = 0; i < n; i++)//3
        {	 	   	    	
            temp = 0;//1
            for (j = 0; j <= i; j++)//3
            {	 	   	    	
                temp += pow(10, j) * (i + 1);//1
            }
            sum = sum + temp;//1
        }
        printf("sum=%ld\n", sum);//1
    }
}